<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>数据采集</title>
	<link rel="stylesheet" type="text/css" href="${ctx}/js/jquery-ui/jquery-ui-1.8.11.custom.css"/>
    <script src="${ctx}/js/jquery-ui/jquery-ui-1.8.11.custom.min.js"></script>  
	<script type="text/javascript">
		
		$(function() {
		$("#createStrategy").dialog({
			autoOpen: false,
			width: 600,
			modal: true,
			resizable: false,
			buttons: {
				"添加策略": function() { 
				   var levelTag = $("#levelTag").val();
				   if(checkFiledName("create") & checkStrategy("create")) {
				   		createStragegy(levelTag, 'create');
				   		clearStragegy("create");
				   		$(this).dialog("close"); 
				   }
				   
				}, 
				" 取消 ": function() { 
				    clearStragegy("create");
					$(this).dialog("close"); 
				}
			}
		});
		
		$("#updateStrategy").dialog({
			autoOpen: false,
			width: 600,
			modal: true,
			resizable: false,
			buttons: {
				"修改策略": function() { 
				   var levelTag = $("#levelTag").val();
				   if(checkFiledName("update") & checkStrategy("update")) {
				   		createStragegy(levelTag, 'update');
				   		clearStragegy("update");
				   		$(this).dialog("close"); 
				   }
				}, 
				" 取消 ": function() { 
				    clearStragegy("update");
					$(this).dialog("close"); 
				}
			}
		});
	});
	
	function showNextStragegy() {
	  var levelObj = $("#level option:selected").val();
	  
	  if(levelObj == "NEXT") {
	     $("#next").show();
	  } else {
	     $("#next").hide();
	  }
	}
	
	function clearStragegy(opt) {
		var name = $("#"+opt+"FiledName").val("");
		var strategy = $("#"+opt+"Strategy option:selected").val();
		
		if(strategy == "TAG"){
			$("#"+opt+"StartTag").val("");
			$("#"+opt+"EndTag").val("");
		} else if(strategy == "REGULAR") {
			$("#"+opt+"Regular").val("");
		} else if(strategy == "XPATH") {
		 	$("#"+opt+"Xpath").val("");
		 	$("#"+opt+"XpathMode").val("");
		}
		$("#"+opt+"Strategy option[value='']").attr("selected",true);
		$("."+opt+"FilterTag").removeAttr("checked");
		var tagDiv = $("#"+opt+"TagDiv");
		var regularDiv = $("#"+opt+"RegularDiv");
		var xpathDiv = $("#"+opt+"XpathDiv");
		tagDiv.hide();
		regularDiv.hide();
		xpathDiv.hide();
	}
	
	function createStragegy(levelTag, opt) {
		var name = $("#"+opt+"FiledName").val();
		var strategy = $("#"+opt+"Strategy option:selected").val();
		var strategyParamValues="";
		var trObj = "";
		var listObj = $("#"+levelTag+"StrategyList");
		var inputName = "";
	
		var lastTr = listObj.find("tr:last");
		var lastTrId = "";
		if(opt == "update") {
			lastTrId = $("#currentTrId").val();
		} else {
			lastTrId = lastTr.attr("id");
		}
		var indexs = lastTrId.split("_");
		if(indexs.length == 2) {
			  var index = indexs[1];
			  if(opt == "update") {
					index = parseInt(index);
				} else {
					index = parseInt(index) + 1;
				}
			  
			  inputName = "collectionStrategies["+index+"]";
			  trObj = "<tr id='"+levelTag+"Index_"+index+"'>";
		 }
		
		
		trObj += "<td class='tdFiledName'><input type='hidden' name='"+inputName+".filedName' value='"+name+"'/><span>"+name+"</span></td><td class='tdStrategy'><input type='hidden' name='"+inputName+".strategy' value='"+strategy+"'/><span>"+strategy+"</span></td>";
		
		if(strategy == "TAG"){
			var startTag = $("#"+opt+"StartTag").val();
			var endTag = $("#"+opt+"EndTag").val();
			
			trObj += "<td class='tdStrategyValue'><input type='hidden' name='"+inputName+".strategyValue.startTag' value='"+startTag+"'/><input type='hidden' name='"+inputName+".strategyValue.endTag' value='"+endTag+"'/><span>"+startTag+","+endTag+"</span></td>";
		} else if(strategy == "REGULAR") {
			var regular = $("#"+opt+"Regular").val();
			trObj += "<td class='tdStrategyValue'><input type='hidden' name='"+inputName+".strategyValue.regular' value='"+regular+"'/><span>"+regular+"</span></td>";
		} else if(strategy == "XPATH") {
		 	var xpath = $("#"+opt+"Xpath").val();
		 	var xpathMode = $("#"+opt+"XpathMode").val();
		 	
		 	trObj += "<td class='tdStrategyValue'><input type='hidden' name='"+inputName+".strategyValue.xpath' value='"+xpath+"'/>";
		 	if($.trim(xpathMode) != "") {
		 		trObj += "<input type='hidden' name='"+inputName+".strategyValue.xpathMode' value='"+xpathMode+"'/><span>"+xpath+","+xpathMode+"</span></td>";
		 	} else {
		 		trObj += "<span>"+xpath+"</span></td>";
		 	}
		 	
		}
		
		var filterTags = $("."+opt+"FilterTag");
		trObj += "<td class='tdFilterTag'>"
		var filterTagValues = "";
		var filterTagInput = "";
		var filterTagText = "";
		filterTags.each(function(i) {
			var filterTag = $(this);
			if(filterTag.attr("checked")) {
				filterTagInput += "<input type='hidden' name='"+inputName+".filterTag["+i+"].tagName' value='"+filterTag.val()+"'/>";
				filterTagText += filterTag.val()+",";
			}
		});
		var lastPosition = filterTagText.lastIndexOf(",");
		if(lastPosition != -1) {
			filterTagText = filterTagText.substring(0, lastPosition);
		}
		trObj += filterTagInput+"<span>"+filterTagText+"</span></td><td><a href='javascript:updateStrategy(\""+levelTag+"Index_"+index+"\",\""+levelTag+"\")'>修改</a>|<a href='javascript:deleteStrategy(\""+levelTag+"Index_"+index+"\")' onclick='return confirm(\"您真的要做删除操作？\")'>删除</a></td></tr>";
		
		if(opt == "update") {
			lastTrId = $("#currentTrId").val();
			$("#"+lastTrId).replaceWith(trObj); 
		} else {
			listObj.append(trObj);
		}
	}
	
	function checkFiledName(opt) {
			 var name = $("#"+opt+"FiledName").val();
		     var nameMsgObj = $("#"+opt+"FiledNameMsg");
		     
		     if($.trim(name) == "") {
		     	nameMsgObj.css("color","red").html("策略字段名称必须指定");
		     	return false;
		     } else {
		     	nameMsgObj.html("");
		     	return true;
		     }
		}
		
	function checkStrategy(opt) {
		    var strategy = $("#"+opt+"Strategy option:selected").val();
			if($.trim(strategy) == "") {
				$("#"+opt+"StrategyMsg").css("color","red").html("必须指定采集策略");
				return false;
			} else if(strategy == "TAG"){
				var startTag = $("#"+opt+"StartTag").val();
				var endTag = $("#"+opt+"EndTag").val();
				
				if($.trim(startTag) == "") {
					$("#"+opt+"StartTagMsg").css("color","red").html("开始标签不能为空");
					return false;
				} else {
					$("#"+opt+"StartTagMsg").html("");
				}
				
				if($.trim(endTag) == "") {
					$("#"+opt+"EndTagMsg").css("color","red").html("结束标签不能为空");
					return false;
				} else {
					$("#"+opt+"EndTagMsg").html("");
				}
				
			} else if(strategy == "REGULAR") {
				var regular = $("#"+opt+"Regular").val();
				if($.trim(regular) == "") {
					$("#"+opt+"RegularMsg").css("color","red").html("正则表达式不能为空");
					return false;
				} else {
					$("#"+opt+"RegularMsg").html("");
				}
			} else if(strategy == "XPATH") {
			 	var xpath = $("#"+opt+"Xpath").val();
			 	if($.trim(xpath) == "") {
					$("#"+opt+"XpathMsg").css("color","red").html("Xpath不能为空");
					return false;
				} else {
					$("#"+opt+"XpathMsg").html("");
				}
			}
			$("#"+opt+"StrategyMsg").html("");
			return true;
		}
		
		function createUrlParam() {
			var url = $("#url").val();
			var urlParam = $("#urlParam");
			var position = -1;
			var htmlContent = ""; 
			var index = 0;
			while((position = url.indexOf("{*}", position+1)) != -1) {
			    htmlContent = "<div class='textRow'><div class='textLabel'>URL参数"+(index+1)+"(<span style='color:red'>*</span>)：<input type='hidden' name='urlParams["+index+"].paramIndex' value='"+index+"' class='textInfo step' /></div><div class='textContent'>开始：<input type='text' name='urlParams["+index+"].start' class='textInfo step' size='5' maxlength='10'/>&nbsp;结束：<input type='text' name='urlParams["+index+"].end' class='textInfo step' size='5' maxlength='10'/>&nbsp;增减：<input type='text' name='urlParams["+index+"].step' class='textInfo step' size='5' maxlength='10'/><span id='stepMsg'></span></div></div>";
				urlParam.append(htmlContent);
				index++;
			}
		}
		
		function changeStrategy(opt) {
			var strategy = $("#"+opt+"Strategy option:selected").val();
			var tagDiv = $("#"+opt+"TagDiv");
			var regularDiv = $("#"+opt+"RegularDiv");
			var xpathDiv = $("#"+opt+"XpathDiv");
			tagDiv.hide();
			regularDiv.hide();
			xpathDiv.hide();
			if(strategy == "TAG"){
				tagDiv.show();
			} else if(strategy == "REGULAR") {
				regularDiv.show();
			} else if(strategy == "XPATH") {
				xpathDiv.show();
			}
		}
		
		function checkTask() {
			var name = $("#name").val();
			var nameMsg = $("#nameMsg");
			var url = $("#url").val();
			var urlMsg = $("#urlMsg");
			
			var nameRs = true;
			var urlRs = true;
			var urlParamRs = true;
			if($.trim(name) == "") {
				nameMsg.css("color", "red").html("任务名称必须填写");
				nameRs = false;
			} else {
				nameMsg.html("");
			}
			if($.trim(url) == "") {
				urlMsg.css("color", "red").html("采集URL必须填写");
				urlRs = false;
			} else {
				if(url.indexOf("{*}") != -1) {
				  var reg = new RegExp("^\\d+$");
				  var steps = $(".step");
				  var rs = true;
				  steps.each(function(i) {
				  	var step = $(this).val();
				  	if(!reg.test($.trim(step))) {
				  		rs = false;
				  	}
				  });
				  if(!rs) {
				  	$("#stepMsg").css("color", "red").html("url参数必须填写，且为数字");
				  	urlParamRs = false;
				  } else {
				  	$("#stepMsg").html("");
				  }
				}
			}
			return nameRs && urlRs && urlParamRs;
		}
		
		function addStrategy(level) {
			$("#levelTag").val(level);
			$("#createStrategy").dialog("open");
		}
		
		function updateStrategy(trId,level) {
			$("#levelTag").val(level);
			$("#currentTrId").val(trId);
			var currentTr = $("#"+trId);
			var filedName = currentTr.find(".tdFiledName").find("span").html();
			var strategy = currentTr.find(".tdStrategy").find("span").eq(0).html();
			var strategyValue = currentTr.find(".tdStrategyValue").find("span").eq(0).html();
			var filterTag = currentTr.find(".tdFilterTag").find("span").eq(0).html();
			
			$("#updateFiledName").val(filedName);
			
			$("#updateStrategy option[value="+strategy+"]").attr("selected",true);
			
			if(filterTag != "") {
				var filterTags = filterTag.split(",");
				
				for(var i=0; i<filterTags.length; i++) {
					var checkObj = $(".updateFilterTag[value="+filterTags[i]+"]");
					if(checkObj) {
						checkObj.attr("checked",true);
					}
				}
			}
			
			var tagDiv = $("#updateTagDiv");
			var regularDiv = $("#updateRegularDiv");
			var xpathDiv = $("#updateXpathDiv");
			tagDiv.hide();
			regularDiv.hide();
			xpathDiv.hide();
			var strategyValues = strategyValue.split(",");
			if(strategy == "TAG"){
				tagDiv.show();
				$("#updateStartTag").val(strategyValues[0]);
				$("#updateEndTag").val(strategyValues[1]);
			} else if(strategy == "REGULAR") {
				regularDiv.show();
				$("#updateRegular").val(strategyValues[0]);
			} else if(strategy == "XPATH") {
				xpathDiv.show();
				$("#updateXpath").val(strategyValues[0]);
				if(strategyValues.length==2) {
				  $("#updateXpathMode").val(strategyValues[1]);
				}
			}
			$("#updateStrategy").dialog("open");
		}
		
		function deleteStrategy(trId) {
			$("#"+trId).remove();
		}
	</script> 
</head>
  <body>
       <div class="content_bg">
 	 	<div class="rhead">
 	 		<div class="rpos">当前位置:  数据采集 - 新建任务</div>
 	 	</div>
 	 	
 	 	<s:form action="updateCollectionTask" theme="simple" onsubmit="return checkTask()">
 	 	<s:hidden name="collectionTask.id" />
 	 	<s:hidden name="taskId" />
 	 	<div class="rhead">
 	 		<div class="textRow"><div class="textLabel">任务名称(<span style="color:red">*</span>)：</div>
 	 		<div class="textContent"><s:textfield name="collectionTask.taskName" cssClass="textInfo" size="40" maxlength="100" id="name"/> <span id="nameMsg" style="color:red"></span></div>
 	 		</div>
 	 		<div class="textRow"><div class="textLabel">任务别名(<span style="color:red">*</span>)：</div>
 	 		<div class="textContent"><s:textfield name="collectionTask.taskAlias" cssClass="textInfo" size="40" maxlength="100" id="alias"/><span id="aliasMsg" style="color:red"></span></div>
 	 		</div>
 	 		<div class="textRow"><div class="textLabel">初始页编码(<span style="color:red">*</span>)：</div>
 	 		<div class="textContent"><s:select name="collectionTask.websiteStrategy.charCode" cssClass="textInfo" list="#{'UTF-8':'UTF-8','GBK':'GBK','GB2312':'GB2312'}"  id="charCode"/><span id="charCodeMsg" style="color:red"></span></div>
 	 		</div>
 	 		<div class="textRow"><div class="textLabel">采集URL(<span style="color:red">*</span>)：</div>
 	 		<div class="textContent"><s:textfield name="collectionTask.websiteStrategy.url" cssClass="textInfo" size="80" maxlength="100" id="url" onblur="createUrlParam()"/><span id="urlMsg" style="color:red">(使用'{*}'匹配多个URL)</span></div>
 	 		</div>
 	 		<div id="urlParam">
 	 			<s:iterator value="collectionTask.websiteStrategy.urlParams" var="param" status="stat">
 	 			<s:hidden name="urlParams[%{#stat.index}].id" value="%{#param.id}" />
 	 			<div class='textRow'><div class='textLabel'>URL参数<s:property value="#stat.count"/>(<span style='color:red'>*</span>)：<s:hidden name="urlParams[%{#stat.index}].paramIndex" value="%{#stat.index}" cssClass='textInfo step' /></div><div class='textContent'>开始：<s:textfield name="urlParams[%{#stat.index}].start" value="%{#param.start}" cssClass='textInfo step' size='5' maxlength='10'/>&nbsp;结束：<s:textfield name="urlParams[%{#stat.index}].end" value="%{#param.end}"  cssClass='textInfo step' size='5' maxlength='10'/>&nbsp;增减：<s:textfield name="urlParams[%{#stat.index}].step" value="%{#param.step}" cssClass='textInfo step' size='5' maxlength='10'/><span id='stepMsg'></span></div></div>
 	 			</s:iterator>
 	 		</div>
 	 		
 	 		<div class="textRow" id="selfStrategy"><div class="textLabel">&nbsp;</div>
 	 		<div class="textContent"><a href="javascript:addStrategy('self')">添加自身页面采集策略</a></div>
 	 		</div>
 	 		
 	 	 <div class="list" style="margin-left:130px;width:900px">
 	 			<table id="selfStrategyList" width="80%" cellpadding="0" cellspacing="0">
 	 				<tr id="selfIndex_-1">
 	 					<th>策略字段名称</th>
 	 					<th>采集策略</th>
 	 					<th>策略参数值</th>
 	 					<th>过滤标签</th>
 	 					<th>操作</th>
 	 				</tr>
 	 				
 	 				<s:iterator value="collectionStrategies" var="strategy" status="stat">
 	 				  <s:hidden name="collectionStrategies[%{#stat.index}].id"/>
 	 				  <s:hidden name="collectionStrategies[%{#stat.index}].next"/>
 	 				  <s:if test="#stat.first">
 	 				  	<tr id="selfIndex_<s:property value="#stat.index"/>">
	 	 					<td><s:hidden name="collectionStrategies[%{#stat.index}].filedName"/><span><s:property value="#strategy.filedName"/></span></td>
	 	 					<td><s:hidden name="collectionStrategies[%{#stat.index}].strategy"/><span><s:property value="#strategy.strategy"/></span></td>
	 	 					<td>
	 	 						<s:if test="collectionStrategies[%{#stat.index}].strategy.toString() == @com.collection.entity.CollectionStrategy$Strategy@TAG.toString()">
	 	 							<s:hidden name="collectionStrategies[%{#stat.index}].strategyValue.startTag"/><s:hidden name="collectionStrategies[%{#stat.index}].strategyValue.endTag"/>
	 	 							<span><s:property value="#strategy.strategyValue.startTag"/>,<s:property value="#strategy.strategyValue.endTag"/></span>
	 	 						</s:if>
	 	 						<s:elseif test="collectionStrategies[%{#stat.index}].strategy.toString() == @com.collection.entity.CollectionStrategy$Strategy@REGULAR.toString()">
	 	 							<s:hidden name="collectionStrategies[%{#stat.index}].strategyValue.regular"/>
	 	 							<span>
	 	 							<s:property value="#strategy.strategyValue.regular"/>
	 	 							</span>
	 	 						</s:elseif>
	 	 						<s:elseif test="collectionStrategies[%{#stat.index}].strategy.toString() == @com.collection.entity.CollectionStrategy$Strategy@XPATH.toString()">
	 	 							<s:hidden name="collectionStrategies[%{#stat.index}].strategyValue.xpath"/><s:hidden name="collectionStrategies[%{#stat.index}].strategyValue.xpathMode"/>
	 	 							<span><s:property value="#strategy.strategyValue.xpath"/> <s:if test="#strategy.strategyValue.xpathMode != null">,<s:property value="#strategy.strategyValue.xpathMode"/></s:if>
	 	 							</span>
	 	 						</s:elseif>
	 	 					</td>
	 	 					<td>
	 	 					  <s:if test="#strategy.filterTag != null">
		 	 					   <s:iterator value="#strategy.filterTag" var="filterTag" status="statFilter">
		 	 					       <s:hidden name="collectionStrategies[%{#stat.index}].filterTag[%{#statFilter.index}].id" />
		 	 						   <s:hidden name="collectionStrategies[%{#stat.index}].filterTag[%{#statFilter.index}].tagName" />
		 	 						</s:iterator>
		 	 						<span>
		 	 						<s:iterator value="#strategy.filterTag" var="filterTag" status="statFilter">
		 	 						   <s:if test="!#statFilter.last">
		 	 						   		<s:property value="#filterTag.tagName"/>,
		 	 						   </s:if>
		 	 						   <s:else>
		 	 						   		<s:property value="#filterTag.tagName"/>
		 	 						   </s:else>
		 	 						</s:iterator>
		 	 						</span>
	 	 						</s:if>
	 	 					</td>
	 	 					<td>操作</td>
 	 				    </tr>
 	 				  </s:if>
 	 				</s:iterator>
 	 			</table>
 	 		</div>
 	 		
 	 		<div id="next" style="display:none">
 	 		<div class="textRow" id="nextStrategy"><div class="textLabel">&nbsp;</div>
 	 		<div class="textContent"><a href="javascript:addStrategy('next')">添加下级页面采集策略</a></div>
 	 		</div>
 	 		
 	 		
 	 		 <div class="list" style="margin-left:130px;width:900px">
 	 			<table id="nextStrategyList" cellpadding="0" cellspacing="0">
 	 				<tr id="nextIndex_0">
 	 					<th>策略字段名称</th>
 	 					<th>采集策略</th>
 	 					<th>策略参数值</th>
 	 					<th>过滤标签</th>
 	 					<th>操作</th>
 	 				</tr>
 	 			</table>
 	 			</div>
 	 		</div>
 	 	</div>
 	 	<div class="rhead">
 	 		<span style="margin-left:140px"><s:submit value="下一步"></s:submit></span>
 	 	</div>
 	 		</s:form>
 	   </div>
 	   
 	   <div id="createStrategy" title="添加策略" style="display:none">
	  	    	<div>策略名称：<input name="strategy.filedName" class="textInfo" maxlength="100" id="createFiledName"/><span id="createFiledNameMsg"></span></div>
	  	    	<div style="margin-top:2px">策 &nbsp;&nbsp;&nbsp;&nbsp;略：
	  	    	<select name="strategy.strategy"  id="createStrategy" onchange="changeStrategy('create')">
	  	    		<option value="">请选择</option>
	  	    		<option value="TAG">标签匹配</option>
	  	    		<option value="REGULAR">正则匹配</option>
	  	    		<option value="XPATH">xpath匹配</option>
	  	    	</select>
	  	    	<span id="createStrategyMsg"></span></div>
	  	    	<div id="createTagDiv" style="display:none">
		  	    	<div style="margin-top:2px">开始标签：<input name="strategyValue.startTag" size="60" class="textInfo" id="createStartTag"/>
		  	    	<span id="createStartTagMsg"></span>
		  	    	</div>
		  	    	<div style="margin-top:2px">结束标签：<input name="strategyValue.endTag" size="60" class="textInfo" id="createEndTag"/>
		  	    	<span id="createEndTagMsg"></span>
		  	    	</div>
		  	    </div>
	  	    	<div id="createRegularDiv" style="display:none">
		  	    	<div style="margin-top:2px">正则表达式：<input name="strategyValue.regular" size="60" class="textInfo" id="createRegular"/>
		  	    	<span id="createRegularMsg"></span>
		  	    	</div>
		  	    </div>
		  	    <div id="createXpathDiv" style="display:none">
		  	    	<div style="margin-top:2px">Xpath表达式：<input name="strategyValue.xpath" size="60" class="textInfo" id="createXpath"/>
		  	    	<span id="createXpathMsg"></span></div>
		  	    	<div style="margin-top:2px">Xpath模式：<input name="strategyValue.xpathMode" size="10" class="textInfo" id="createXpathMode"/>
		  	    	<span id="createXpathModeMsg" style="color:red">*若为默认模式不需填写，填写格式为(attr:属性名 或 tag:标签名)</span>
		  	    	</div>
		  	    </div>
		  	    
		  	    <div style="margin-top:2px">过滤标签：<input type="checkbox" name="strategy.filterTag" value="a" class="createFilterTag"/>a <input type="checkbox" name="strategy.filterTag" value="img" class="createFilterTag"/>img
		  	    	<input type="checkbox" name="strategy.filterTag" value="div" class="createFilterTag"/>div <input type="checkbox" name="strategy.filterTag" value="script" class="createFilterTag"/>script
		  	    </div>
  	   </div>
  	   <div id="updateStrategy" title="修改策略" style="display:none">
	  	    	<div>策略名称：<input name="strategy.filedName" class="textInfo" maxlength="100" id="updateFiledName"/><span id="updateFiledNameMsg"></span></div>
	  	    	<div style="margin-top:2px">策 &nbsp;&nbsp;&nbsp;&nbsp;略：
	  	    	<select name="strategy.strategy"  id="updateStrategy" onchange="changeStrategy('update')">
	  	    		<option value="">请选择</option>
	  	    		<option value="TAG">标签匹配</option>
	  	    		<option value="REGULAR">正则匹配</option>
	  	    		<option value="XPATH">xpath匹配</option>
	  	    	</select>
	  	    	<span id="updateStrategyMsg"></span></div>
	  	    	<div id="updateTagDiv" style="display:none">
		  	    	<div style="margin-top:2px">开始标签：<input name="strategyValue.startTag" size="60" class="textInfo" id="updateStartTag"/>
		  	    	<span id="updateStartTagMsg"></span>
		  	    	</div>
		  	    	<div style="margin-top:2px">结束标签：<input name="strategyValue.endTag" size="60" class="textInfo" id="updateEndTag"/>
		  	    	<span id="updateEndTagMsg"></span>
		  	    	</div>
		  	    </div>
	  	    	<div id="updateRegularDiv" style="display:none">
		  	    	<div style="margin-top:2px">正则表达式：<input name="strategyValue.regular" size="60" class="textInfo" id="updateRegular"/>
		  	    	<span id="updateRegularMsg"></span>
		  	    	</div>
		  	    </div>
		  	    <div id="updateXpathDiv" style="display:none">
		  	    	<div style="margin-top:2px">Xpath表达式：<input name="strategyValue.xpath" size="60" class="textInfo" id="updateXpath"/>
		  	    	<span id="updateXpathMsg"></span></div>
		  	    	<div style="margin-top:2px">Xpath模式：<input name="strategyValue.xpathMode" size="10" class="textInfo" id="updateXpathMode"/>
		  	    	<span id="updateXpathModeMsg" style="color:red">*若为默认模式不需填写，填写格式为(attr:属性名 或 tag:标签名)</span>
		  	    	</div>
		  	    </div>
		  	    
		  	    <div style="margin-top:2px">过滤标签：<input type="checkbox" name="strategy.filterTag" value="a" class="updateFilterTag"/>a <input type="checkbox" name="strategy.filterTag" value="img" class="updateFilterTag"/>img
		  	    	<input type="checkbox" name="strategy.filterTag" value="div" class="updateFilterTag"/>div <input type="checkbox" name="strategy.filterTag" value="script" class="updateFilterTag"/>script
		  	    </div>
  	   </div>
  	   <input type="hidden" name="levelTag" id="levelTag"/>
  	   <input type="hidden" name="currentTrId" id="currentTrId"/>
  </body>
</html>



